import React from 'react'
import { Layout, Menu, Icon, LocaleProvider } from 'antd'; // Breadcrumb
// eslint-disable-next-line
import zh_CN from 'antd/lib/locale-provider/zh_CN';
import { Link, withRouter } from 'react-router-dom';
// import { Provider } from 'react-redux';
// import store from '@/store';
import RouteContent from './routeContent';
import './App.pcss';

const {
    Header,
    Content,
    Sider,
} = Layout;

const { Item } = Menu;

class App extends React.Component {
    render() {
        // const { location } = this.props;

        return (
            // eslint-disable-next-line
            <LocaleProvider locale={zh_CN}>
                <Layout style={{ minHeight: '100vh' }}>
                    <Header className="header" style={{ position: 'fixed', zIndex: 1, width: '100%' }}>
                        <div className="logo">LOGO</div>
                    </Header>
                    <Layout style={{ paddingTop: 64 }}>
                        <Sider style={{ position: 'fixed', left: 0, background: '#fff', height: '100vh' }}>
                            <Menu onSelect={this.onSelect}>
                                <Item key="1">
                                    <Link to="/"><Icon type="pie-chart" />首页</Link>
                                </Item>
                                <Item key="2">
                                    <Link to="/counter"><Icon type="desktop" />计时器</Link>
                                </Item>
                                <Item key="3">
                                    <Link to="/userManage"><Icon type="team" />用户管理</Link>
                                </Item>
                            </Menu>
                        </Sider>
                        <Content style={{ marginLeft: '200px' }}>
                            {/* <Breadcrumb style={{ margin: '16px' }}>
                                <Breadcrumb.Item>User</Breadcrumb.Item>
                                <Breadcrumb.Item>Bill</Breadcrumb.Item>
                            </Breadcrumb> */}
                            <RouteContent />
                        </Content>
                    </Layout>
                </Layout>
            </LocaleProvider>
        );
    }
}

export default withRouter(App);
